<?php echo $row['membertype']?>问题
来源:百度知道 编辑:UC知道 时间:2024/09/24 10:10:40
当 membertype= 1 时显示:A
当 membertype= 2 时显示:B
当 membertype= 3 时显示:C
这个该怎么实现?
当 membertype= 2 时显示:B
当 membertype= 3 时显示:C
这个该怎么实现?
首先,你的分号不应该遗漏:
<?php echo $row['membertype'];?>
其次:membertype的值与你的代码无关,因为你的代码是显示数组的值:
echo $row['membertype'];
最后:
把1,2,3……转换为A,B,C,……的例子代码如下:
<?php
$n=2;
$str=chr(ord('A')+$n-1);
echo $str;
?>
switch($row['membertype']){
case 1:
echo 'A';break;
case 2:
echo 'B';break;
case 3:
echo 'C';break;
}
<?php echo($php_self); ?>什么也不显示是怎么回事?
PHP echo语法的一个问题
PHP中echo输出HTML问题
echo "<a href='phpwan.php?pageno=($pageno+1)'>下一页</a> ";
能打开一个 网站名/pass.txt 知道其中的内容为 <?php echo md5('kiss'); ?> 改如何入侵?
PHP SQL ICMP ECHO PCI ISA是什么意思 呀
请教:这个php中的echo怎么写呢?!
php代码释义-<?php
PHP中象echo.print.<br>之类的都是些什么词语.都有什么作用.象这类的词语还有哪些.请路过高手回答!谢谢了!
有谁知道ECHO的一首歌叫<风筝祭>歌词